<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP 4.3.2 or newer
 *
 * @package		CodeIgniter
 * @author		ExpressionEngine Dev Team
 * @copyright	Copyright (c) 2008 - 2009, EllisLab, Inc.
 * @license		http://codeigniter.com/user_guide/license.html
 * @link		http://codeigniter.com
 * @since		Version 1.0
 * @filesource
 */
require 'Transporter.php';
require 'Base.php';
require 'Property.php';
require 'Zestimate.php';
require 'Chart.php';
require 'Factory.php';

class Zillow {

	

	/**
	 * Constructor
	 *
	 * @access	public
	 * @param	string
	 * @return	void
	 */
	function Zillow()
	{
		
	}

	function getSetimate($address, $city, $state, $zip){
		$pf = new Pillow_Factory('X1-ZWz1bxhyiblcej_3mmvk');
		try {
			$search = $pf->findDeepProperties($address, $city." ".$state." ".$zip );
			if( count($search) > 0 )
			{
				return $search[0]->zestimate->amount;
			}
		} catch (Exception $e) {
			return "0";
		}
	}
}
